package com.mpsc.seata.provite.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * @author yangzyh
 * @date 2021/1/18 18:08
 */
@ControllerAdvice
public class CustomExceptionHandler {
    private static final Logger LOG = LoggerFactory.getLogger(CustomExceptionHandler.class);

    @ExceptionHandler
    //@ResponseStatus(HttpStatus.BAD_REQUEST)
    public void handle(Exception e) throws Exception {
        LOG.error("Returning HTTP 400 Bad Request", e);
        throw e;
    }
}
